﻿<%@ page pageEncoding="UTF-8"%>
<%@include file="/util/tag.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <%@include file="../common/head.jsp"%>
    <script language="javascript" type="text/javascript">
            //保存成功的提示信息
            function showResult() {
                showResultDiv(true);
                window.setTimeout("showResultDiv(false);", 3000);
            }
            function showResultDiv(flag) {
                var divResult = document.getElementById("save_result_info");
                if (flag)
                    divResult.style.display = "block";
                else
                    divResult.style.display = "none";
            }
            function showMsg(){
            	var ok = "${ok}";
            	if(ok=="1"){
            		showResult();
            	}else if(ok=="0"){
            		var divResult = document.getElementById("save_result_info");
            					divResult.className="save_fail";
            					divResult.innerHTML="保存失败，旧密码错误！";
            					showResult();
            	}
            }
             $(function(){
            $("#userForm").validate({
            	rules:{
            	"oldpwd":"required",
            	"newpwd":"required",
            	"conpwd":{required:true,equalTo:"#password"}
            	},messages:{
            		"oldpwd":"请填写旧密码",
            	"newpwd":"30长度以内的字母、数字和下划线的组合",
            	"conpwd":{required:"请填写重复密码",equalTo:"两次新密码必须相同"}
            	},errorPlacement:function(error,element) {
            		 error.appendTo(element.siblings(":last").addClass("error_msg"));
            	},success:function(label,element){
            		 	$(element).siblings(":last").removeClass("error_msg").empty();
            		 }
            	});
            });
        </script>
    </head>
    <body onload="showMsg();">
        <%@include file="../common/top.jsp"%>
        
        <div id="main">      
            <!--保存操作后的提示信息：成功或者失败-->      
            <div id="save_result_info" class="save_success">保存成功！</div><!--保存失败，旧密码错误！-->
            <form action="modi_pwd" method="post" class="main_form" id="userForm">
                <div class="text_info clearfix"><span>旧密码：</span></div>
                <div class="input_info">
                    <input type="password" class="width200" name="oldpwd" /><span class="required">*</span>
                    <div class="validate_msg_medium"></div>
                </div>
                <div class="text_info clearfix"><span>新密码：</span></div>
                <div class="input_info">
                    <input type="password"  class="width200" name="newpwd" id="password"/><span class="required">*</span>
                    <div class="validate_msg_medium"></div>
                </div>
                <div class="text_info clearfix"><span>重复新密码：</span></div>
                <div class="input_info">
                    <input type="password" class="width200" name="conpwd" /><span class="required">*</span>
                    <div class="validate_msg_medium"></div>
                </div>
                <div class="button_info clearfix">
                    <input type="submit" value="保存" class="btn_save" />
                </div>
            </form>  
        </div>
        
        <%@include file="../common/bottom.jsp"%>
    </body>
</html>
